package test.boid.vo;

import java.util.HashMap;

import dviz.visualSystem.impl.AnimationObject;

import com.jme.math.Quaternion;
import com.jme.math.Vector3f;
import com.jme.scene.Node;
import com.jme.scene.shape.*;

// This is the visual object that can be used to visualize Java Objects
// By using @ObjectMap("sphere")
public class SphereVO extends AnimationObject {
	
	public SphereVO(HashMap<String, Object> initVector) {
		super(initVector);

		// Getting the Root Node for this Object to be rendered onto the screen
		Node renderNode = getRenderNode();
		// Create a new sphere to be rendered onto screen (JMonkeyEngine API)
		Sphere sphere = new Sphere("", new Vector3f(), 10, 10, 1);
//		sphere.setLocalRotation(new Quaternion(new float[] {
//				(float) Math.PI / 2f, 0, 0 }));
//		sphere.setLocalScale(0.2f);
		// Box sphere = new Box("", new Vector3f(-1, -1, -1),
		// new Vector3f(1, 1, 1));
		// Attach this object onto the render root node
		renderNode.attachChild(sphere);
	}

	public void setX(float x) {
		getRenderNode().getLocalTranslation().setX(x);
	}

	public void setSize(float size) {
		getRenderNode().setLocalScale(size);
	}

	public void setY(float y) {
		getRenderNode().getLocalTranslation().setY(y);
	}

	public void setZ(float z) {
		getRenderNode().getLocalTranslation().setZ(z);
	}

}
